using Kopernikus.Parsing.Lexing;

namespace Kopernikus.Parsing.GenericLexing
{
    public class GenericMatch<S> : IConvertToSymbol
    {
        private readonly LexerMatch m_match;
        private readonly S m_value;

        public GenericMatch(S value, LexerMatch match)
        {
            m_value = value;
            m_match = match;
        }

        public S Value
        {
            get { return m_value; }
        }

        #region IConvertToSymbol Members

        public Symbol Symbol
        {
            get { return m_match.Symbol; }
        }

        #endregion

        public override string ToString()
        {
            return m_match.ToString();
        }
    }
}